<link  href="admin/css/jsDatePick_ltr.min.css" rel="stylesheet" type="text/css" media="all" />
<script type="text/javascript" src="admin/css/jsDatePick.min.1.3.js"></script>
<script type="text/javascript">
window.onload = function(){
	new JsDatePick({
		useMode:2,
		target:"birthday",

		dateFormat:"%Y-%m-%d"
	});
	new JsDatePick({
		useMode:2,
		target:"startwork",

		dateFormat:"%Y-%m-%d"
	});
};

function validate(){
	var username = document.getElementById("username").value;
	var password = document.getElementById("pass").value; 
	var repassword = document.getElementById("repass").value;

	if(username.length==0){
		alert('You must input username!');
		return false;
	}else if(password.length == 0){
		alert('You must input password!');
		return false;
	}else if(repassword.length == 0){
		alert('You must input repassword!');
		return false;
	}
	else if(password != repassword){
		alert('Password must the same repassword!');
		return false;
	}
}

function reset(){
	document.getElementById("username").value="";
	document.getElementById("pass").value ="";
	document.getElementById("repass").value ="";
	document.getElementById("fulln").value ="";
	document.getElementById("employeeCode").value ="";
	document.getElementById("identity").value ="";
	document.getElementById("bankName").value ="";
	document.getElementById("bankAccount").value ="";
	document.getElementById("birthday").value ="";
	document.getElementById("startwork").value ="";
	document.getElementById("mail").value ="";
	document.getElementById("mobile").value ="";
	document.getElementById("phone").value ="";
	document.getElementById("address").value ="";
	document.getElementById("position").value ="";
	document.getElementById("currentJob").value ="";
	document.getElementById("description").value ="";
}

</script>

<?php 
session_start();

$sqldeparment = mysql_query("SELECT dl.IDDepartment,dl.DepartmentName FROM department_lang dl WHERE dl.LangID='".$_SESSION['lang']."' ORDER BY dl.IDDepartment;");

$sqlrole = mysql_query("SELECT IDRole,Description from roles ");

$sqlsex = mysql_query("select ac_sex.SexID,ac_sex_lang.SexName  from ac_sex , ac_sex_lang	where ac_sex.SexID=ac_sex_lang.SexID 
			            				and ac_sex_lang.LangID='".$_SESSION['lang']."'");

?>

<div id="contains" style="background-color: #edf4f7;">

	<div class="title"></div>
	<div class="body">
	<form action="admin/employeemanagement/process-create-new-account.php" id="formregister" method="get" onsubmit="return validate();">
		<div id="storeForm" style="margin-left: 5px;">
			<span id="head"><?=$l_createaccount?></span>
			<div id="content">
			<span
					style="padding: 3px 3px 0px 3px; color: #508E21;"> <?=$l_personaldetail?>
				</span>
				<table style="border-top: 1px dotted silver;width: 100%;">
					<tr>
						<td width="15%" class="tdFirst"><?=$l_username?> :</td>
						<td width="35%"><input id="username" name="username" type="text"
							value="" maxlength="20" style="width: 100%;"
							class="textfiledCompany" /></td>
						<td width="15%" class="tdFirst"><?=$l_fullname?> :</td>
						<td width="35%"><input id="fulln" name="fulln" type="text"
							value="" maxlength="100" style="width: 100%;"
							class="textfiledCompany" />
						</td>
					</tr>
					<tr>
						<td width="15%" class="tdFirst"><?=$l_password?> :</td>
						<td width="35%"><input type="password" id="pass" name="pass" value=""
							maxlength="20" style="width: 100%;" class="textfiledCompany" /></td>
						<td width="150px" class="tdFirst"><?=$l_retypepassword?> :</td>
						<td width="35%"><input type="password" id="repass" name="repass"
							maxlength="20" style="width: 100%;" class="textfiledCompany" />
						</td>
					</tr>
					<tr>
						<td width="150px" class="tdFirst"><?=$l_employeecode?> :</td>
						<td width="35%"><input id="employeeCode" name="employeeCode"
							type="text" value="" maxlength="20" style="width: 100%;"
							class="textfiledCompany" /></td>
						<td width="150px" class="tdFirst"><?=$l_cmnd?> :</td>
						<td width="35%"><input id="identity" name="identity" type="text"
							value="" maxlength="50" style="width: 100%;"
							class="textfiledCompany" />
						</td>
					</tr>
					<tr>
						<td width="15%" class="tdFirst"><?=$l_bankname?> :</td>
						<td width="35%"><input id="bankName" name="bankName" type="text"
							value="" maxlength="50" style="width: 100%;"
							class="textfiledCompany" /></td>
						<td width="15%" class="tdFirst"><?=$l_bankaccount ?> :</td>
						<td width="35%"><input id="bankAccount" name="bankAccount"
							type="text" value="" maxlength="50" style="width: 100%;"
							class="textfiledCompany" />
						</td>
					</tr>
					<tr>
						<td width="150px" class="tdFirst"><?=$l_birthday?> :</td>
						<td width="35%"><span style="z-index: 1;"><span style="white-space: nowrap;">
							<input id="birthday" name="birthday"
								type="text" value="" maxlength="50" style="width: 100%;"
								class="textfiledCompany" /></span> </span></td>
						<td width="15%" class="tdFirst"><?=$l_sex?> :</td>
						<td width="35%"><select id="sex" name="sex" size="1"
							style="width: 100%;height: 22px;">
							<?php while ($row = mysql_fetch_array($sqlsex)){?>
								<option value="1" selected="selected"><?php echo $row[SexName];?></option>
								<?php }?>
						</select></td>
					</tr>
					<tr>
						<td width="15%" class="tdFirst"><?=$l_startwork?> :</td>
						<td width="35%"><span style="z-index: 1;"><span style="white-space: nowrap;">
							 <input id="startwork" name="startwork"
								type="text" value="" maxlength="50" style="width: 100%;"
								class="textfiledCompany" /> </span> </span></td>

						<td width="15%" class="tdFirst"><?=$l_email?> :</td>
						<td width="35%"><input id="mail" name="mail" type="text"
							maxlength="200" style="width: 100%;" class="textfiledCompany" />
						</td>
					</tr>
					<tr>
						<td width="15%" class="tdFirst"><?=$l_mobile?> :</td>
						<td width="35%"><input id="mobile" name="mobile" type="text"
							maxlength="30" style="width: 100%;" class="textfiledCompany" />
						</td>
						<td width="15%" class="tdFirst"><?=$l_phone?> :</td>
						<td width="35%"><input id="phone" name="phone" type="text"
							maxlength="20" style="width: 100%;" class="textfiledCompany" /></td>
					</tr>
					<tr>
						<td width="15%" class="tdFirst"><?=$l_address?> :</td>
						<td colspan="3"><input id="address" name="address" type="text"
							maxlength="255" style="width: 520px" class="textfiledCompany" />
						</td>
					</tr>
				</table>
				<span
					style="border-bottom: 1px dotted silver; display: block; padding: 3px 3px 0px 3px; color: #508E21;">
					<?=$l_positioninfo?> </span>
				
				<table style="width: 100%;">
					<tr >
						<td width="150px" class="tdFirst"><?=$l_department?> :</td>
						<td width="35%"><select id="department" name="department" size="1"
							style="width: 100%;height: 22px;">
							<?php while($row=mysql_fetch_array($sqldeparment)){?>
								<option value="<?=$row[IDDepartment]?>" id="<?=$row[IDDepartment]?>"><?php echo $row['DepartmentName']?></option>
								<?php }?>
						</select></td>
						<td width="150px" class="tdFirst"><?=$l_accessright?> :</td>
						<td width="35%"><select id="roleaccess" name="roleaccess" size="1"
							style="width: 100%;height: 22px;">
							<?php while ($rowrole = mysql_fetch_array($sqlrole)){?>
								<option value="<?=$rowrole[IDRole]?>" id="<?=$rowrole[IDRole]?>"><?php echo $rowrole[Description];?></option>
								<?php }?>
						</select></td>
					</tr>
					<tr>
						<td width="15%" class="tdFirst"><?=$l_position?> :</td>
						<td width="35%"><input id="position" name="position" type="text"
							maxlength="200" style="width: 100%;" class="textfiledCompany" />
						</td>
						<td class="tdFirst" width="15%"><?=$l_accountant?> :</td>
						<td width="35%"><table style="width: 100px">
								<tr>
									<td><input id="accountant" type="radio" name="accountant" value="1" /><label>
											Yes</label></td>
									<td><input id="accountant" type="radio" name="accountant" checked="checked"
										value="0" /><label> No</label></td>
								</tr>
							</table></td>
					</tr>
					<tr>
						<td valign="top" width="15%" class="tdFirst"><?=$l_responsibilities?> :</td>
						<td colspan="3"><input id="currentJob" name="currentJob"
							type="text" maxlength="100" style="width: 515px"
							class="textfiledCompany" /></td>
					</tr>
					<tr>
						<td valign="top" width="15%" class="tdFirst"><?=$l_description?> :</td>
						<td colspan="3"><textarea id="description" name="description"
								class="textareaEmp"></textarea></td>
					</tr>
				</table>
				<span
					style="border-top: 1px dotted silver; display: block; height: 2px;"></span>
				<div style="text-align: right; margin-top: 10px">
					<input id="register" name="register" type="submit" value="<?=$l_register?>" 
						class="buttonNormal" /> <input id="reset" name="reset" onclick="reset();"
						type="reset" value="<?=$l_reset?>" class="buttonNormal" />
				</div>
			</div>
		</div>
</form>
	</div>
</div>
